package net.godcode.olivenotes.pages.blog;

import java.util.List;

import net.godcode.olivenotes.entities.Post;
import net.godcode.olivenotes.entities.PostDAO;

import org.apache.tapestry.ioc.annotations.Inject;
import org.slf4j.Logger;

/**
 * The blog home page.
 * 
 * @author Chris Lewis Dec 26, 2007 <chris@thegodcode.net>
 * @version $Id: Start.java 22 2008-01-19 09:17:14Z burningodzilla $
 */
public class Start {
	
	@Inject
	private PostDAO postDao;
	
	@Inject
	private Logger log;
	
	/**
	 * 
	 */
	private Post post;
	
	private boolean flag = false;
	
	void onActivate() {
		
	}
	
	public List<Post> getRecentPosts() {
		return postDao.findRecent(5, true);
	}
	
	/* Post#post is a just holder for loop iterations. */
	
	/**
	 * @return the post
	 */
	public Post getPost() {
		return post;
	}

	/**
	 * @param post the post to set
	 */
	public void setPost(Post post) {
		this.post = post;
	}
	
}